home *** CD-ROM | disk | FTP | other *** search
/ EuroCD 3 / EuroCD 3.iso / Programming / Amos / AMOSList-0497 / AMOSLIST / text0016.txt < prev    next >
Encoding:
Text File  |  1998-06-24  |  1.4 KB  |  58 lines

  1. On 03-apr-97 Jamie B wrote:
  2.  
  3. >Okay, I'm not going to brag on about anything... All I want to know
  4. >is how to use normaly inputs and take "BITS" from it, and make it
  5. >NON case sensative...
  6. >  So if I took say this:
  7. >
  8. > Eat the cow
  9. >
  10. > And the cow didn't exist, it should say:
  11. >
  12. > There is no cow to eat.
  13.  
  14. Split the input into words, using Instr() to find the spaces.
  15.  
  16. Your parser must know about 'eat' and 'the' of course.
  17.  
  18. Compare 'cow' with the list of possible nouns. If it is not there, print the
  19. message (i.e. Print "There is no ";NOUN$;" to eat").
  20.  
  21. If you are making a text adventure, you might as well take a look at the
  22. several adventure development systems there are. A whole bunch of them can be
  23. found at ftp://ftp.gmd.de/if-archive/.
  24.  
  25. > I don't know ho to do that normally...
  26. > Also: Case sensetive etc:
  27. >
  28. > I want this:
  29. >
  30. >     HELLO
  31. >
  32. > To be the same as this:
  33. >    
  34. >     HeLlO
  35. >
  36. > (No case discrimination)...
  37.  
  38. Have the test words in memory in upper case only. So:
  39. VERB$(1) = "EAT"
  40. VERB$(2) = "HELLO"
  41. VERB$(3) = "NORTH", etc.
  42.  
  43. Now, before you test, convert the input to uppercase:
  44.  
  45. UPIN$ = Upper$(IN$)
  46.  
  47. Hello, HEllO, HELLO, hello, etc. will all be converted to uppercase and can so
  48. be tested against the list of test words.
  49.  
  50. -----
  51. Branko Collin       http://www.xs4all.nl/~collin
  52. collin@xs4all.nl    http://www.kun.nl/undans/members/branko.htm
  53.      "Erm... Erm... should I say something interesting now?"
  54.                          - Branko Collin -
  55.  
  56.  
  57.